<template>
	<view>

		<view class="mode">
			<view class="u-flex " style="justify-content: space-around;text-align: center;">
				<view @click="dirman">
					<view class="" style="font-size: 40rpx;">
						{{info.dirman}}
					</view>
					<view>
						直邀好友
					</view>
				</view>
				<view>
					<view class="" style="font-size: 40rpx;">
						￥{{info.allprice}}
					</view>
					<view>
						累计分销
					</view>
				</view>
			</view>
		</view>
		

	    <view style="margin:0 auto 40rpx auto;width: 140rpx;">
		
						<u-image src="/static/dirfriends.png" width="140" height="60"></u-image>
		
	    </view>
		

		<view v-for="(item,index) in list " :key="index" class="mode  list">
			<view class="u-flex">
				<u-image :src="item.headimg" width="100" height="100" shape="circle"></u-image>
				<view style="width: 580rpx;margin-left: 20rpx;">
					<view class="u-line-1" style="color: #333;font-size: 40rpx;">{{item.nickname}}</view>
					<view class="u-margin-top-20">手机:{{item.mobile}}</view>
				<!-- 	<view class="u-flex u-row-between u-margin-top-40 " style="color: #999;">
						<view>累计分销:{{item.total}}</view>
						<view>今日分销:{{item.todaytotal}}</view>
					</view> -->
					
				</view>


			</view>

			<view class="img">
				
				<u-image :src="item.levelId==1?'/static/degree_1.png':''" width="90" height="30" v-if="item.levelId==1"></u-image>
				<u-image :src="item.levelId==2?'/static/degree_2.png':''" width="90" height="30" v-if="item.levelId==2"></u-image>
				<u-image :src="item.levelId==3?'/static/degree_3.png':''" width="90" height="30" v-if="item.levelId==3"></u-image>
				
			</view>

		</view>





		<u-loadmore :status="status" />
	</view>

</template>

<script>
	export default {

		data() {
			return {
				info: {
	
				
					allprice: "",
					dirman: "",
					
				},

				status: 'loadmore',
				page: 1,
				list: []


			}
		},
		methods: {
			dirman() {
				uni.navigateTo({
					url: "./dirfriends"
				})
			},
			zijin(){
				this.$u.post('/api/Financial/info', {
					
				}, {}).then(res => {
					var {totalCommission,totalOne,totalTwo}=res.data;
				    this.info.allprice=totalCommission
				    this.info.dirman=totalOne,
				    this.info.kuosanman=totalTwo
				    
				}).catch(err => {})
			
			},
			team(){
				this.$u.post('/api/user/team', {
					
				}, {}).then(res => {
					var resList = res.data			  
					if (this.page == 1) {
						this.list = []
					}
					if (resList.length > 9) {
						this.status = 'loadmore'
						this.page = this.page + 1
					} else {
						this.status = 'nomore'
					}
					this.list = this.list.concat(resList)
					this.loading = false
				    
				}).catch(err => {})
			
			}
		},
		onLoad() {
	     	this.zijin()
			
			this.team()
		}
	}
</script>

<style lang="scss">
	@import '../../pages/my/common.css';

	.list {
		position: relative;

		.img {
			position: absolute;
			top: 20rpx;
			right: 20rpx;
		}
	}
</style>
